package com.yksj.healthtalk.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
 * 购买者资料
 * @author Administrator
 *
 */
public class ShopperEntity implements Serializable{
	private String CUSTOMER_ID;// 4200, 
	private String ROLE_ID;// 1
	private String INFO_VERSION;// 
	private String CUSTOMER_ACCOUNTS;//"3022308",
	private String CUSTOMER_LOCUS;// "361100",
	private String DWELLING_PLACE;// "江西省 上饶市",
	private String PERSONAL_NARRATE;// "只要有梦，踮起脚尖，就更靠近阳光。",
	private String CUSTOMER_SEX;// "W",
	private String HEAD_PORTRAIT_TYPE;//  "Customer",
	private String BIG_ICON_BACKGROUND;// "W",
	private String CLIENT_ICON_BACKGROUND;// "W",
	private String REL_TYPE;// Y 表示已关注
	private String REMARKS_NAME;//
	private String CUSTOMER_NICKNAME;
	
	public String getCUSTOMER_NICKNAME() {
		return CUSTOMER_NICKNAME;
	}
	public void setCUSTOMER_NICKNAME(String cUSTOMER_NICKNAME) {
		CUSTOMER_NICKNAME = cUSTOMER_NICKNAME;
	}
	public String getCUSTOMER_ID() {
		return CUSTOMER_ID;
	}
	public void setCUSTOMER_ID(String cUSTOMER_ID) {
		CUSTOMER_ID = cUSTOMER_ID;
	}
	public String getROLE_ID() {
		return ROLE_ID;
	}
	public void setROLE_ID(String rOLE_ID) {
		ROLE_ID = rOLE_ID;
	}
	public String getINFO_VERSION() {
		return INFO_VERSION;
	}
	public void setINFO_VERSION(String iNFO_VERSION) {
		INFO_VERSION = iNFO_VERSION;
	}
	public String getCUSTOMER_ACCOUNTS() {
		return CUSTOMER_ACCOUNTS;
	}
	public void setCUSTOMER_ACCOUNTS(String cUSTOMER_ACCOUNTS) {
		CUSTOMER_ACCOUNTS = cUSTOMER_ACCOUNTS;
	}
	public String getCUSTOMER_LOCUS() {
		return CUSTOMER_LOCUS;
	}
	public void setCUSTOMER_LOCUS(String cUSTOMER_LOCUS) {
		CUSTOMER_LOCUS = cUSTOMER_LOCUS;
	}
	public String getDWELLING_PLACE() {
		return DWELLING_PLACE;
	}
	public void setDWELLING_PLACE(String dWELLING_PLACE) {
		DWELLING_PLACE = dWELLING_PLACE;
	}
	public String getPERSONAL_NARRATE() {
		return PERSONAL_NARRATE;
	}
	public void setPERSONAL_NARRATE(String pERSONAL_NARRATE) {
		PERSONAL_NARRATE = pERSONAL_NARRATE;
	}
	public String getCUSTOMER_SEX() {
		return CUSTOMER_SEX;
	}
	public void setCUSTOMER_SEX(String cUSTOMER_SEX) {
		CUSTOMER_SEX = cUSTOMER_SEX;
	}
	public String getHEAD_PORTRAIT_TYPE() {
		return HEAD_PORTRAIT_TYPE;
	}
	public void setHEAD_PORTRAIT_TYPE(String hEAD_PORTRAIT_TYPE) {
		HEAD_PORTRAIT_TYPE = hEAD_PORTRAIT_TYPE;
	}
	public String getBIG_ICON_BACKGROUND() {
		return BIG_ICON_BACKGROUND;
	}
	public void setBIG_ICON_BACKGROUND(String bIG_ICON_BACKGROUND) {
		BIG_ICON_BACKGROUND = bIG_ICON_BACKGROUND;
	}
	public String getCLIENT_ICON_BACKGROUND() {
		return CLIENT_ICON_BACKGROUND;
	}
	public void setCLIENT_ICON_BACKGROUND(String cLIENT_ICON_BACKGROUND) {
		CLIENT_ICON_BACKGROUND = cLIENT_ICON_BACKGROUND;
	}
	public String getREL_TYPE() {
		return REL_TYPE;
	}
	public void setREL_TYPE(String rEL_TYPE) {
		REL_TYPE = rEL_TYPE;
	}
	public String getREMARKS_NAME() {
		return REMARKS_NAME;
	}
	public void setREMARKS_NAME(String rEMARKS_NAME) {
		REMARKS_NAME = rEMARKS_NAME;
	}
	
	public static List<ShopperEntity> parseToList(String content){
		List<ShopperEntity> entities=new ArrayList<ShopperEntity>();
		try {
			JSONArray array=new JSONArray(content);
			for (int i = 0; i < array.length(); i++) {
				JSONObject object= (JSONObject) array.get(i);
				ShopperEntity entity=new ShopperEntity();
				entity.setBIG_ICON_BACKGROUND(object.optString("BIG_ICON_BACKGROUND"));
				entity.setCLIENT_ICON_BACKGROUND(object.optString("CLIENT_ICON_BACKGROUND"));
				entity.setCUSTOMER_ACCOUNTS(object.optString("CUSTOMER_ACCOUNTS"));
				entity.setCUSTOMER_ID(object.optString("CUSTOMER_ID"));
				entity.setCUSTOMER_LOCUS(object.optString("CUSTOMER_LOCUS"));
				entity.setCUSTOMER_SEX(object.optString("CUSTOMER_SEX"));
				entity.setDWELLING_PLACE(object.optString("DWELLING_PLACE"));
				entity.setHEAD_PORTRAIT_TYPE(object.optString("HEAD_PORTRAIT_TYPE"));
				entity.setINFO_VERSION(object.optString("INFO_VERSION"));
				entity.setPERSONAL_NARRATE(object.optString("PERSONAL_NARRATE"));
				entity.setREL_TYPE(object.optString("REL_TYPE"));
				entity.setREMARKS_NAME(object.optString("REMARKS_NAME"));
				entity.setROLE_ID(object.optString("ROLE_ID"));
				entity.setCUSTOMER_NICKNAME(object.optString("CUSTOMER_NICKNAME"));
				entities.add(entity);
			}
			return entities;
		} catch (JSONException e) {
			return null;
		}
	}
}
